using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input.Touch;
using TicTacToe.GC;
using TicTacToe.GamePlay;

namespace TicTacToe.GS
{
    public class GSMainMenu : GameStateFactory<GSMainMenu>, IGameState
    {
        private GameControl btnSinglePlay = new GameControl("SinglePlay", GameCoordinate.X_CENTER_480 - 140, GameCoordinate.Y_CENTER_800 - 200);
        private GameControl btnMultiPlay = new GameControl("MultiPlay", GameCoordinate.X_CENTER_480 - 140, GameCoordinate.Y_CENTER_800 - 100);
        private GameControl btnTeamInfo = new GameControl("TeamInfo", GameCoordinate.X_CENTER_480 - 140, GameCoordinate.Y_CENTER_800);

        public GSMainMenu()
        {
            btnSinglePlay.OnPressedEvent += new OnPressedHandler(btnSinglePlay_OnPressedEvent);
            btnMultiPlay.OnPressedEvent += new OnPressedHandler(btnMultiPlay_OnPressedEvent);
            btnTeamInfo.OnPressedEvent += new OnPressedHandler(btnTeamInfo_OnPressedEvent);

            AddControls();
        }

        void btnTeamInfo_OnPressedEvent(object sender)
        {
            this.GetGameMain().SetGameState(GSTeamInfo.GetInstance());
        }

        void btnMultiPlay_OnPressedEvent(object sender)
        {
            this.GetGameMain().SetGameState(GSMultiPlay.GetInstance());
        }

        private void btnSinglePlay_OnPressedEvent(object sender)
        {
            this.GetGameMain().SetGameState(GSSinglePlay.GetInstance());
        }

        private void AddControls()
        {
            gameControls.Add(btnSinglePlay);
            gameControls.Add(btnMultiPlay);
            gameControls.Add(btnTeamInfo);
        }
    }
}
